﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WishZT.aspx.cs" Inherits="WishZT" %>

<!doctype html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title><%=this.pZhuanTiName%>专题-<%=web.WebName%></title>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="keywords" content=<%="\""+web.Keyword+"\""%>  />
    <meta name="description" content= <%="\""+web.Description+"\"" %>  />
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/css/WishNote.css?id=2") %>" />
    <%if (false)
      { %>
    <script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <% } %>
    <script src='<%=ResolveUrl("~/Scripts/jquery-1.4.1.min.js")%>' type="text/javascript"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src='<%=ResolveUrl("~/Scripts/html5shiv.min.js")%>'></script>
    <![endif]-->
    <script type="text/javascript" src='<%=ResolveUrl("~/Scripts/pngfix.js")%>'></script>
    <script type="text/javascript" src='<%=ResolveUrl("~/Scripts/DD_belatedPNG_0.0.8a-min.js")%>'></script>
    <script type="text/javascript" src='<%=ResolveUrl("~/Scripts/noteswall.js")%>'></script>
    <script type="text/javascript" src='<%=ResolveUrl("~/Scripts/time.js")%>' charset="gb2312"></script>
    <style type="text/css">
        body
        {
            font: 12px 微软雅黑, Verdana, Tahoma, Lucida Grande, Arial, sans-serif;
            <%=this.pBackground%>
            padding: 0px;
            margin: 0px;
            color:<%= this.pFontColor%>;
        }
        a
        {
            text-decoration: none;
            color: #0777c3;
        }
        a:hover
        {
            color: #FF6600;
        }
        input[disabled]
        {
            color: #d9d9d9;
        }
        a:visited
        {
        }
        #main_body
        {
            width:960px;
            left:50%;
            margin-left:-480px;
            position:relative;
        }
        #top_body
        {
            width:100%;
            position:relative;
        }
        #top_body img
        {
            margin:0px;
            border:0px;
            display:block;
        }
        #top_body #send_open
        {
            width:210px;
            height:70px;
            display:inline-block;
            position:absolute;
            right:100px;
            bottom:50px;
            z-index:10;
            background:url('<%=ResolveUrl("~/Images/send_wish.png")%>') no-repeat; 
            
        }
        #top_body #send_open:hover
        {
            background:url('<%=ResolveUrl("~/Images/send_wish_hover.png")%>') no-repeat; 
        }
        #top_body #bunner
        {
            width:100%;
        }
        #top_body #menu_dv
        {
            position:absolute;
            bottom:50px; 
            left:100px;
            width:400px;
            height:42px;
            background:url('<%=ResolveUrl("~/Images/xuyuan_menu_bg.png")%>') no-repeat;
        }
        #top_body #menu_dv #to_home
        {
            display:inline-block;
            height:33px;
            padding-left:80px;
            padding-top:7px;
            font-size:20px;
            font-weight:bold;
        }
        #con_body
        {
            border-radius:0px 0px 15px 15px;
            -webkit-border-radius:0px 0px 15px 15px;
            -moz-border-radius:0px 0px 15px 15px;
             width:100%;
             padding-bottom:10px;
             <%=this.pConBackground%>
             
        }
        #con_body #wall
        {
            margin:0 auto;
            width:960px;
            height:600px;
            overflow:hidden;
            position:relative; 
        }
        #foot_body
        { 
            height:60px; 
            padding-top:30px;
            text-align:center;
            width:100%;
        }
        
        #localtime
        {
            margin-left:30px;
        }
        #mian_mask
        {
            display: block;
            background: url('<%=ResolveUrl("~/image/WishingWallmask.png")%>') repeat;
            z-index: 700;
            position: fixed;
            width: 100%;
            top: 0px;
            left: 0px;
        }
    </style>
    <script type="text/javascript">
        var bdheight = document.documentElement.clientHeight; //获取浏览器窗体高度
        var bdwidth = document.documentElement.clientWidth; //获取浏览器窗体宽度
        jQuery(document).ready(function () {
            noteDrag.init(960 - 210, 600 - 151); //初始化贴纸范围
            timeTick.init(); //初始化计时器
            setSendBodyTop(); //设置send_body顶部位置
            jQuery("#main_mask").css("height", $(document).height() + "px");

            jQuery("#send_open").click(function () {
                setSendBodyTop();
                sendbodyShow();
            });
            jQuery("#sned_close").click(
                function () {
                    sendbodyHide();
                }
            );
            jQuery(window).scroll(
                function () {
                    setSendBodyTop();
                }
            );
        });
        var setSendBodyTop = function () {
            var send_body = jQuery("#send_body");
            send_body.css('top', (bdheight / 2 - send_body.outerHeight() / 2) + jQuery(document).scrollTop() + "px");
            var main_mask = jQuery("#main_mask");
            if (main_mask.height() + jQuery(document).scrollTop() < jQuery(document).outerHeight())
                main_mask.css("top", jQuery(document).scrollTop());
        }
        var sendbodyShow = function () {
            jQuery("#send_body").css("display", "block");
            jQuery("#main_mask").css("display", "block");


        }
        var sendbodyHide = function () {
            jQuery("#send_body").css("display", "none");
            jQuery("#main_mask").css("display", "none");

        }
        var change_code = function () {
            //更新验证码
            document.getElementById("check_code").src = '<%=ResolveUrl("~/UserControl/CheckCode.aspx?r= ") %>' + Math.random();
        }

        var isInteger = function (s) {
            //检测字符是否为数字
            var pattern = /^([-]){0,1}([0-9]){1,}([.]){0,1}([0-9]){0,}$/;
            if (!pattern.test(s))
                return false;
            return true;
        }

        var check_name_tb = function () {
            if (jQuery("[id$=name_tb]").val().length == 0) {
                alert("请输入您的姓名");
                return false;
            }
            return true;
        }
        var check_toname_tb = function () {
            if (jQuery("[id$=toname_tb]").val().length == 0) {
                alert("请问您要祝福谁");
                return false;
            }
            return true;

        }
        var check_qq_tb = function () {
            if (jQuery("[id$=qq_tb]").val().length == 0) {
                alert("请留下你的QQ");
                return false;
            }
            if (!isInteger(jQuery("[id$=qq_tb]").val())) {
                alert("QQ必须为数字，请正确填写您的QQ");
                return false;
            }
            return true;
        }
        var check_lei_ddl = function () {
            if (jQuery("[id$=lei_ddl]").val() == 0) {
                alert("请选择祝福类型");
                return false;
            }
            return true;
        }
        var check_game_tb = function () {
            if (jQuery("[id$=game_tb]").val().length == 0) {
                alert("请输入祝福语");
                return false;
            }
            if (jQuery("[id$=game_tb]").val().length > 45) {
                alert("祝福内容只能输入不多于　45　个字");
                return false;
            }
            return true;
        }
        var check_ycode_tb = function () {
            if (jQuery("[id$=ycode_tb]").val().length == 0) {
                alert("请输入验证码");
                return false;
            }
            return true;
        }
        var check_submit = function () {
            //提交验证输入是否正确
            if (!check_name_tb())
                return false;
            if (!check_toname_tb())
                return false;
            if (!check_qq_tb())
                return false;
            if (!check_lei_ddl())
                return false;
            if (!check_game_tb())
                return false;
            if (!check_ycode_tb())
                return false;
            return true;
        }
        var hitPraise = function (obj, ni) {
            var hitb = obj;
            $(hitb).removeAttr("onclick");
            jQuery.get('<%=ResolveUrl("~/Ajax/M_Hit_Praise.ashx")%>', { i: ni }, function (resoult) {
                if (resoult != "-1") {
                    //                    alert($(hitb).find(".hit_count").text());
                    $(hitb).find(".hit_count").html(resoult);
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        <asp:HiddenField ID="zhuantiID_hf" runat="server" />
        <div id="main_mask" class="pngFix">
        </div>
        <div id="send_body" class="pngFix">
                <div id="send_body_in">
                    <table>
                        <tr>
                            <td colspan="3" style=" background-color:#8fd3fe;">
                                <a href="javascript:void(0)" id="sned_close" ></a>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                输入你的祝福纸条内容<font color="#ff0000">（只能输入不多于　45　个字）</font>
                            </td>
                            <td rowspan="5" style=" width:200px;">
                                <div class="notePreview">
                                    <div class="xumain">
                                        <div class="hands">
                                            <span class="close" >
                                        </span>
                                        </div>
                                        <div class="coimg">
                                            <span id="keytoname">自己</span>
                                        </div>
                                        <div class="text">
                                            &nbsp;&nbsp;&nbsp;<span id="keygame">祝福内容预览</span>
                                        </div>
                                        <div class="user">
                                            <span id="keyname">匿名</span>
                                        </div>
                                        <div class="qdate">
                                            <span class="qqsp">
                                                <span id="keyqq"></span>
                                            </span> 
                                            <span class="dsp">
                                                    <%=DateTime.Now.ToString("yyyy-MM-dd") %>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="send_td_left">
                                您的姓名：
                            </td>
                            <td>
                                <asp:TextBox ID="name_tb" Text="匿名" MaxLength="8" onclick="if(this.value =='匿名') this.value='';" onkeyup="keyname.innerHTML=this.value;" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="send_td_left">
                                您要祝福谁：
                            </td>
                            <td>
                                <asp:TextBox ID="toname_tb" MaxLength="8" runat="server" onkeyup="keytoname.innerHTML=this.value;"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="send_td_left">
                                您的QQ：
                            </td>
                            <td>
                                <asp:TextBox ID="qq_tb" runat="server" MaxLength="13" ></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="send_td_left">
                                选择类型：
                            </td>
                            <td>
                                <asp:DropDownList ID="lei_ddl" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="send_td_left">
                                祝福语：
                            </td>
                            <td colspan="2" style=" padding:5px 0px 5px 0px;">
                                <asp:TextBox ID="game_tb" runat="server" MaxLength="45" TextMode="MultiLine" onkeyup="keygame.innerHTML=this.value;" style=" width:95%; height:70px;"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="send_td_left">验证码：
                            </td>
                            <td colspan="2">
                                <asp:TextBox ID="ycode_tb" runat="server"></asp:TextBox>
                                <a href="javascript:void();" onclick="change_code(); return false;">
                                   <img alt="换一个验证码" src='<%=ResolveUrl("~/UserControl/CheckCode.aspx") %>' id="check_code" style=" height:22px; width:60px; margin-bottom:-6px; border:0px;"/>
                                </a>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <asp:Button ID="submit_btn" runat="server" Text="保存我的愿望" OnClick="submit_btn_Click" OnClientClick="return check_submit();"
                                    style=" float:right; margin-right:10px;" />
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        <div id="main_body">
            <div id="top_body">
                <img id="bunner" src='<%=this.pBunnerImg %>' alt="" />
                <a href="javascript:void(0)" id="send_open" class="pngFix"></a>
                <div id="menu_dv"  class="pngFix">
                    <a href='<%=ResolveUrl("~/") %>' id="to_home" class="pngFix">社团首页</a>
                </div>
            </div>
            <div id="con_body">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div id="wall"><a name='wall'></a>
                    <asp:Repeater ID="nodelist_rp" runat="server">
                        <ItemTemplate>
                            <div name="note" class="note" style='z-index: <%#(this.pagesize+10-Container.ItemIndex)%>; left:<%#rd.Next(750)%>px;top:<%#rd.Next(449)%>px'>
                                <div class="xumain">
                                    <div class="hands">
                                        <%#(nowpages == 1 & Container.ItemIndex < 3) ? "<img class='new_icon' src='" + ResolveUrl("~/Images/new_msg.gif") + "' alt='' />" : ""%>
                                        <span class="close" onclick="closeDiv(this)"></span>
                                    </div>
                                    <div class="coimg">
                                        <%# Eval("qtname")%>
                                    </div>
                                    <div class="text">
                                        &nbsp;&nbsp;&nbsp;
                                        <%#(nowpages == 1 & Container.ItemIndex < 3) ? "<font color='#008fd0'>" + Eval("qgame") + "</font>" : Eval("qgame")%>
                            
                                    </div>
                                    <div class="user">
                                        <%# Eval("qname")%>
                                    </div>
                                    <div class="qdate">
                                        <span class="qqsp">
                                            <a href="javascript:void(0);" onclick='hitPraise(this,<%#Eval("id") %>);'>
                                                <img src='<%=ResolveUrl("~/Images/m_hit_icon.png")%>' alt=""/>
                                                <span class="hit_count"><%# Convert.ToInt32( Eval("qhits"))==0 ? "赞" : Eval("qhits")%></span>
                                            </a>
                                        </span> 
                                        <span class="dsp">
                                                <%# FormatTime.format( Eval("qdate").ToString()) %>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
                <span id="page_sp" style="position: relative; width: 540px; left: 50%; margin-left: -270px;display: inline-block;">
                    <asp:LinkButton ID="toone" runat="server" OnClick="toone_Click">[首页]</asp:LinkButton>
                    <asp:LinkButton ID="toup" runat="server" OnClick="toup_Click">[上一页]</asp:LinkButton>&nbsp;
                    <asp:LinkButton ID="tonext" runat="server" OnClick="tonext_Click">[下一页]</asp:LinkButton>
                    <asp:LinkButton ID="tolast" runat="server" OnClick="tolast_Click">[尾页]</asp:LinkButton>&nbsp;
                    [跳转到第
                    <asp:DropDownList ID="jumppage" runat="server" OnSelectedIndexChanged="jumppage_SelectedIndexChanged"
                        AutoPostBack="true" Style="height: 20px; margin-left: 3px; margin-bottom: -3px;">
                    </asp:DropDownList>
                    页]&nbsp;&nbsp; [页次:<asp:Label ID="curpage" runat="server" ForeColor="red"></asp:Label>
                    /
                    <asp:Label ID="sumpage" runat="server" Text="Label"></asp:Label>页] [共<asp:Label ID="pagesum"
                        runat="server" Text="Label" ForeColor="red"></asp:Label>项
                    <asp:Label ID="tpagesizes" runat="server" Text="Label" ForeColor="red"></asp:Label>项/页]
                </span>
            </ContentTemplate>
            </asp:UpdatePanel>
            </div>
            <div id="foot_body">
                <%=web.BottomText%>
                &nbsp;&nbsp;&nbsp;powered by davis
                <%if( Page.Request.UserHostAddress.Substring(0,3)!="192")%>
                        <%=web.OutHits%>
                <br /> <br />
                距离<%=this.pZhuanTiName%>还有&nbsp;[&nbsp;<font color="#FFFFFF"> <%=this.daySpace%></font>&nbsp;]&nbsp;天
                <span id="localtime"></span>
            </div>
        </div>
    </form>
</body>
</html>
